#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py
# Date    : 2021-02-04
# Author  : Tom.Lee

import random

num_prefix = ("133", "149", "153", "173", "177", "180", "181", "189", "190", "191", "193",
              "199", "130", "131", "132", "145", "155", "156", "166", "167", "171", "175",
              "176", "185", "186", "196", "134", "135", "136", "137", "138", "139", "144",
              "147", "148", "150", "151", "152", "157", "158", "159", "172", "178", "182",
              "183", "184", "187", "188", "195", "197", "198", "170", "174")


# for pre in num_prefix:
#     suffix = random.randint(1, 99999999)
#     phone = "{}{:0>8}".format(pre,suffix)
#     # phone = "%s%0.8d" % (pre,suffix)
#     print(phone)

def make_test_data(n:int):
    if n < 1 or n>100000000:
        raise ValueError("有效范围是1~100000000")
    data_list = []
    for i in range(n):
        prefix = random.choice(num_prefix)
        phone = "{}{:0>8}".format(prefix, i)
        pwd = "Ss_{:0>6}".format(i)
        data_list.append({"phone": str(phone), "passord": str(pwd)})
    return data_list


if __name__ == '__main__':
    datas = make_test_data(5)
    print(datas)